﻿using System;
using System.ComponentModel.Composition;
using System.Windows;
using Security.Specs.ViewModels;

namespace Security.View
{
    [Export(typeof(IMainView))]
    internal class MainView : IMainView
    {
        private MainWindow window;
        private readonly ISecurityViewModel viewModel;

        [ImportingConstructor]
        public MainView(ISecurityViewModel viewModel)
        {
            this.viewModel = viewModel;
        }

        public Window MainWindow
        {
            get
            {
                if (window == null)
                    window = new MainWindow(viewModel);

                return window;
            }
        }
    }
}